﻿<%@ Page Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true" CodeBehind="CACorpRegAudit.aspx.cs" Inherits="RN.ERP.Web.CA.CACorpRegAudit" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="../Scripts/jquery.min.js"></script>
<script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#btnSearch").click(function () {
            RefreshGrid("");
        });
    });

    function RefreshGrid(condition) {
        $("#<%= hdnCondition.ClientID %>").val(condition);
        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
    }

    function getImage(guid,type) {
        top.$.ligerDialog.open({ url: "../Enterprise/UploadFileShowList.aspx?filename=" + guid + "&funcCode=" + type + "&sysCode=EF&fileType=.jpg", width: 820, height: 650, title: '', isResize: true, buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        return false;
    }

    function getComments(sender, args) {
        var btn = args.get_item().get_text();
        if (btn == "审核") {
            PassExec();
        }else if (btn == "退回") {
            RejectExec();
        }
    }

    function PassExec() {
        $.ligerDialog.prompt('审核意见', '', true, function (yes, value) {
            if (yes) {
                $("#<%= hdnComments.ClientID %>").val(value);
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Audit");
            }
            else {
                return false;
            }
        });
    }

    function RejectExec() {
        $.ligerDialog.prompt('退回意见', '', true, function (yes, value) {
            if (yes) {
                $("#<%= hdnComments.ClientID %>").val(value);
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Back");
            }
            else {
                return false;
            }
        });
    }

    function ShowCorpView(corpGuid,aURL) {
        var _win = top.ChildDialogWin = window;
        var currCheckBox = _win.$(aURL).parents("tr:eq(0)").find(":checkbox");
        currCheckBox.attr("checked", true);
        var _dialog = top.ChildDialog = top.$.ligerDialog.open({
            url: "CA/CACorpRegInfo.aspx?CorpUserGuid=" + corpGuid,
            width: 1180,
            height: 800,
            title: '',
            buttons: [
                {
                    text: '审核',
                    onclick: function (item, dialog) {
                        _dialog.frame.$.ligerDialog.prompt('审核意见', '', true, function (yes, value) {
                            if (yes) {
                                _win.$("#<%= hdnComments.ClientID %>").val(value);
                                _win.$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Audit");
                                _dialog.close();
                                currCheckBox.attr("checked", false);
                            }
                            else {
                                currCheckBox.attr("checked", false);
                                return false;
                            }
                        });
                    }
                },
                {
                    text: '退回',
                    onclick: function (item, dialog) {
                        _dialog.frame.$.ligerDialog.prompt('退回意见', '', true, function (yes, value) {
                            if (yes) {
                                _win.$("#<%= hdnComments.ClientID %>").val(value);
                                _win.$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Back");
                                _dialog.close();
                            }
                            else {
                                return false;
                            }
                        });
                    }
                },
                {
                    text: '关闭',
                    onclick: function (item, dialog) {
                        currCheckBox.attr("checked", false);
                        _dialog.close();
                    }
                }
            ]
        });
        top.setChildDialogClose(this, "RefreshGrid");
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="table">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ListCorps" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ListCorps">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ListCorps" LoadingPanelID="RadAjaxLoadingPanel1">
                        </telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="false" Skin="Office2010Blue" />
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"
            DecorationZoneID="deco1" Skin="Office2010Blue"></telerik:RadFormDecorator>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td class="left_con">
                    &nbsp;
                </td>
                <td style="padding-left: 6px; padding-right: 6px;" valign="top">
                    <div id="deco1">
                        <div style="padding: 20px; font-size: 14px;">
                            <span style="float: left; padding-right: 10px; line-height: 38px;">企业名称: </span>
                            <asp:TextBox ID="txtTitle" runat="server" Style="width: 200px; height: 25px; line-height: 25px;
                                float: left; padding-right: 10px"></asp:TextBox>&nbsp;&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlStatus" runat="server" Style="width: 100px; height: 25px;
                                line-height: 31px; margin-top: 5px; border: 0;">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlut" runat="server" Style="width: 100px; height: 25px;
                                line-height: 31px; margin-top: 5px; border: 0;">
                            </asp:DropDownList>
                            <input type="button" id="btnSearch" class="xtbiao" value="查询" />
                        </div>
                    </div>
                    <div>
                        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel" LoadingPanelID="RadAjaxLoadingPanel1"
                            HorizontalAlign="NotSet">
                            <telerik:RadGrid ID="ListCorps" runat="server" AutoGenerateColumns="False" CellSpacing="0"
                                Width="100%" Culture="zh-CN" GridLines="None" AllowFilteringByColumn="false"
                                AllowPaging="true" AllowCustomPaging="true" AllowMultiRowSelection="false" OnNeedDataSource="ListCorps_NeedDataSource"
                                AllowSorting="false" ShowStatusBar="true" Skin="Office2010Blue">
                                <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
                                    <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
                                        AllowColumnResize="True"></Resizing>
                                </ClientSettings>
                                <%--操作按钮--%>
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="CorpUserGuid" Font-Size="14px"
                                    CommandItemDisplay="Top">
                                    <CommandItemSettings ExportToPdfText="导出PDF" />
                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="false">
                                    </RowIndicatorColumn>
                                    <CommandItemTemplate>
                                        <telerik:RadToolBar ID="RadToolBar1" runat="server"  AutoPostBack="true"  OnClientButtonClicking="getComments">
                                            <Items>
                                                <telerik:RadToolBarButton  CheckOnClick="true" runat="server"  Text="审核">
                                                </telerik:RadToolBarButton>
                                                <telerik:RadToolBarButton CheckOnClick="true"  runat="server" Text="退回">
                                                </telerik:RadToolBarButton>
                                            </Items>
                                        </telerik:RadToolBar>
                                    </CommandItemTemplate>
                                    <Columns>
                                        <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" HeaderStyle-Width="50px">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server"></asp:CheckBox>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="true"
                                            Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="CorpUserGuid" HeaderText="CorpUserGuid" UniqueName="CorpUserGuid" ReadOnly="true"
                                            Visible="false"/>
                                        <telerik:GridTemplateColumn DataField="CorpName" HeaderText="企业名称" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="200px">
                                        <ItemTemplate>
                                        <a href="javascript:void(0);" onclick="ShowCorpView('<%#Eval("CorpUserGuid") %>',this)"
                                            title="点击查看企业信息"><span style="color: #43a9f5">
                                                <%#Eval("CorpName")%></span></a>
                                        </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="企业类型" HeaderStyle-Width="100px">
                                            <ItemTemplate>
                                                <%#Eval("RoleId") == null ? "" : GetCorpClassKind(Eval("RoleId").ToString())%>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="工商注册地" HeaderStyle-Width="100px">
                                            <ItemTemplate>
                                                <%#Eval("AreaCode") == null ? "" : GetAddress(Eval("AreaCode").ToString())%>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn HeaderText="组织机构代码" DataField="OrginazationCode" ItemStyle-Width="100px">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="审核流程码" DataField="FlowCode" UniqueName="FlowCode" ItemStyle-Width="100px" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <%--<telerik:GridTemplateColumn HeaderText="图片查看">
                                        <ItemTemplate>
                                        <a id="CorpStamp" onclick="getImage('<%#Eval("CorpUserGuid")%>','CorpStamp')">企业公章</a><br />
                                        <a id="PsnStamp" onclick="getImage('<%#Eval("CorpUserGuid")%>','PsnStamp')">法人公章</a><br />
                                        </ItemTemplate>
                                        </telerik:GridTemplateColumn>--%>
                                        <telerik:GridBoundColumn HeaderText="审核状态" DataField="strFlowCode" ItemStyle-Width="100px">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="联系电话" DataField="Tel" ItemStyle-Width="100px">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="注册时间" DataField="GetDate" ItemStyle-Width="100px"
                                            DataFormatString="{0:yyyy-MM-dd}">
                                        </telerik:GridBoundColumn>

                                         <telerik:GridBoundColumn  DataField="FlowCodeType" Display="false">
                                        </telerik:GridBoundColumn>
                                       <%--  <telerik:GridTemplateColumn Display="false">
                                            <ItemTemplate>
                                                 <%#Eval("FlowCodeType")%>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>--%>
                                    </Columns>
                                </MasterTableView>
                                <ClientSettings EnableRowHoverStyle="true">
                                    <Selecting AllowRowSelect="True"></Selecting>
                                </ClientSettings>
                                <PagerStyle AlwaysVisible="True" />
                                <FilterMenu EnableImageSprites="False">
                                </FilterMenu>
                            </telerik:RadGrid>
                        </telerik:RadAjaxPanel>
                    </div>
                    <!--#企业列表结束-->
                </td>
                <td class="right_con">
                    &nbsp;
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hdnCondition" runat="server" />
        <asp:HiddenField ID="hidSysError" runat="server" />
        <asp:HiddenField ID="hdnComments" runat="server" />
       <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue">
        </telerik:RadWindowManager>
    </div>
</asp:Content>


